<h1><%= t('.title') %></h1>

<%= form_with(model: user, url: profile_path) do |form| %>
  <fieldset>
    <legend><%= t(".stories_feed_settings") %></legend>
    <%= form.label :stories_order %>
    <%= form.select :stories_order, User.stories_orders.transform_keys {|k| User.human_attribute_name("stories_order.#{k}") } %>
  </fieldset>
  <%= form.submit("Update") %>
<% end %>

<%= form_with(model: user, url: profile_path) do |form| %>
  <fieldset>
    <legend><%= t('.change_username') %></legend>
    <div class="warning">
      <p><%= t('.warning_html') %></p>
    </div>
    <%= form.label :username %>
    <%= form.text_field :username, required: true %>
    <%= form.label :password_challenge, "Existing password" %>
    <%= form.password_field :password_challenge, required: true %>
  </fieldset>
  <%= form.submit("Update username") %>
<% end %>

<%= form_with(model: user, url: password_path) do |form| %>
  <fieldset>
    <legend><%= t('.change_password') %></legend>
    <%= form.label :password_challenge, "Existing password" %>
    <%= form.password_field :password_challenge, required: true %>
    <%= form.label :password, "New password" %>
    <%= form.password_field :password, required: true %>
    <%= form.label :password_confirmation %>
    <%= form.password_field :password_confirmation, required: true %>
  </fieldset>
  <%= form.submit("Update password") %>
<% end %>
